<?php
header('content-type:text/html;charset=utf-8');
$username=md5($_POST['username']);
//echo $username;
$password=md5($_POST['password']);
//echo $password;
$link=mysql_connect('localhost','root','root') or die('连接失败'.mysql_error());
mysql_select_db('blog',$link);
mysql_set_charset('utf8');
$sql="insert into login(`username`,`password`) values('$username','$password')";
$res=mysql_query($sql);
if($res){
    echo "<script>alert('添加成功');window.location.href='index.php'</script>";
}else{
    echo "<script>alert('添加失败');window.location.href='index.php'</script>";

}
?>